/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package DB;

import java.io.IOException;
import org.basex.core.BaseXException;
import org.basex.core.Context;
import org.basex.query.QueryException;

/**
 * This class demonstrates database creation and dropping. It then shows how to
 * add indexes to the database and retrieve some information on the database
 * structures.
 * 
* @author BaseX Team 2005-12, BSD License
 */
public class TestingClass {

    public TestingClass() {
    }

    public static void main(final String[] args) throws BaseXException, QueryException, IOException {
        final BaseXClient session = new BaseXClient("localhost", 1984, "admin", "admin");
        Context context = new Context();
        try {
           
            session.execute("open BD");
            System.out.println(session.info());
//            InputStream bais = new ByteArrayInputStream("<teste>sdas</teste>".getBytes());
            session.execute("add <x>x</x>");
            System.out.println(session.info());
            session.execute("rename BD.xml teste.xml");
            System.out.println(session.info());
            session.close();
            context.close();
        }catch(Exception e){
            System.out.println(e);
        }


    }
}
